"""
@Project: pythonPro1
@Name: objDemo.py
@Author: linxin_liu
@Date: 2022/9/25 13:51
"""
from dataclasses import dataclass


@dataclass
class Man:
    salary: float  # 薪资
    like: str  # 爱好
    __count: int  # 私有属性 _没有做控制

    def do(self, sth):
        print('man do {} but man like is {}'.format(sth, self.like))

    def get_count(self):
        print('the man count is {}'.format(self.__count))

    def get_man(self):
        print('man info: salary:{} like:{} count:{}'.format(self.salary, self.like, self.__count))


@dataclass
class Woman:
    like: str
    __count: int

    def get_woman(self):
        print('woman info: like:{} count:{}'.format(self.like, self.__count))

    def do(self, sth):
        print('woman do {} but woman like is {}'.format(sth, self.like))

    def get_count(self):
        print('the woman count is {}'.format(self.__count))


class Children(Man, Woman):
    food = ''

    def __init__(self, like, count, salary, food):
        Man.__init__(self, salary, like, count)
        Woman.__init__(self, like, count)
        self.food = food

    def get_children(self):
        print('child info: like:{} count: {} salary:{} food:{}'
              .format(self.like, self.get_count(), self.salary, self.food))


man = Man('5000.0', 'play games', 10000000)
man.get_man()
man.get_count()
man.do('play')

print()
woman = Woman('reading', 9999999)
woman.get_woman()
woman.do('cook')
woman.get_count()

print()
child = Children('swim', 8888888, '0', 'apple')
child.get_children()
